#include <bits/stdc++.h>
#define uLL unsigned long long
#define File(xxx) freopen(xxx".in","r",stdin),freopen(xxx".out","w",stdout)
using namespace std;
const int N = 5e5+5;
typedef long long LL;
int n, opt[N], gg[N], tot, cnt, rk[N], lll;
LL sum;
long double pp[N];
struct qwq {
	LL f, t, b;
}zhan[N];
struct qvq {
	long double op; int d;
}op[N];
struct tree {
	int mm;
	LL tr[N];
	void clear(int xx) {
		mm=xx;
		for(int i = 1; i <= mm; ++i)
			tr[i]=0;
	}
	void add(int x, LL w) { while(x <= mm) tr[x]+=w, x+=(x&(-x)); }
	LL ask(int x, LL ret = 0) { while(x >= 1) ret+=tr[x], x-=(x&(-x)); return ret; }
}trk, trb;

template <typename T> inline void debug(T x) { cerr<<x; }
template <typename T, typename ...T_> inline void debug(T x, T_ ...p) { cerr<<x<<' ', debug(p...); }
template <typename T> void read(T& x) {
	x = 0; int f = 0; char c = getchar();
	while(c < '0' || c > '9') f |= (c == '-'), c=getchar();
	while(c >= '0' && c <= '9') x=(x<<1)+(x<<3)+(c^48), c=getchar();
	x=(f ? -x : x);
}
int lne; char put[105];
template <typename T> void write(T x, char ch) {
	lne = 0; if(x < 0) putchar('-'), x=-x;
	do { put[++lne]=x%10, x/=10; } while(x);
	while(lne) putchar(put[lne--]^48);
	putchar(ch);
}
int comp(qvq A, qvq B) {
	return A.op < B.op;
}
void out() {
	if(!cnt) {
		write(sum, '\n');
		return ;
	}
	int l = 1, r = lll, ans = lll;
	while(l <= r) {
		int mid = ((l+r)>>1);
		if(trk.ask(mid) <= 0)
			ans=mid, l=mid+1;
		else
			r=mid-1;
	}
	printf("%.10Lf\n", (long double) pp[ans]*trk.ask(ans)+trb.ask(ans)+sum);
}

signed main() {
	File("love");
	read(n);
	for(int i = 1; i <= n; ++i) {
		read(opt[i]);
		if(opt[i] == 1) {
			++tot;
			gg[i]=tot;
			read(zhan[tot].f), read(zhan[tot].t), read(zhan[tot].b);
			if(zhan[tot].t < 0) zhan[tot].t=-zhan[tot].t, zhan[tot].b=-zhan[tot].b;
			if(zhan[tot].t != 0) 
				op[++cnt]=qvq {(long double) 1.0*zhan[tot].b/zhan[tot].t+zhan[tot].f, tot};
		}
		else
			read(gg[i]);
	}
	if(cnt) {
		sort(op+1, op+1+cnt, comp);
		for(int i = 1; i <= cnt; ++i) {
			if(i == 1 || op[i].op != op[i-1].op)
				pp[++lll]=op[i].op;
			rk[op[i].d]=lll;
		}
		trk.clear(lll);
		trb.clear(lll);
	}
	for(int i = 1; i <= n; ++i) {
		if(opt[i] == 1) {
			if(zhan[gg[i]].t == 0) 
				sum=sum+abs(zhan[gg[i]].t*zhan[gg[i]].f+zhan[gg[i]].b);
			else {
				trk.add(1, -zhan[gg[i]].t);
				trk.add(rk[gg[i]]+1, 2LL*zhan[gg[i]].t);
				trb.add(1, zhan[gg[i]].t*zhan[gg[i]].f+zhan[gg[i]].b);
				trb.add(rk[gg[i]]+1, -2LL*(zhan[gg[i]].t*zhan[gg[i]].f+zhan[gg[i]].b));
			}
		}
		else {
			if(zhan[gg[i]].t == 0) 
				sum=sum-abs(zhan[gg[i]].t*zhan[gg[i]].f+zhan[gg[i]].b);
			else {
				trk.add(1, zhan[gg[i]].t);
				trk.add(rk[gg[i]]+1, -2LL*zhan[gg[i]].t);
				trb.add(1, -(zhan[gg[i]].t*zhan[gg[i]].f+zhan[gg[i]].b));
				trb.add(rk[gg[i]]+1, 2LL*(zhan[gg[i]].t*zhan[gg[i]].f+zhan[gg[i]].b));
			}
		}
		out();
	}
	return 0;
}
